<?php

class ImportModule extends fvModule {

    function __construct () {
        $moduleName = strtolower(substr(__CLASS__, 0, -6));

        parent::__construct(fvSite::$fvConfig->get("modules.{$moduleName}.smarty.template"), 
                            fvSite::$fvConfig->get("modules.{$moduleName}.smarty.compile"), 
                            fvSite::$Layoult);
    }

    function showIndex() {
        return $this->__display('index.tpl');
    }
    
    function showGettabcontent () {
        $r = fvRequest::getInstance();
        $tabId = $r->getRequestParameter('tabId');
        
        $ImportedObjects = ImportedObjectManager::getInstance()->getAll("object_name = ?", null, null, array(ucfirst($tabId)));
        
        foreach ($ImportedObjects as $ImportedObject) {
            $res[] = array(
                'id' => $ImportedObject->getPk(),
                'object' => unserialize($ImportedObject['object_hash']),
            );
        }
        
        $this->__assign("ImportedObjects", $res);
        
        return $this->__display("{$tabId}.tpl");
    }
}

?>
